<?php

class Country_Model_DbTable_Countries extends Engine_Db_Table
{
  protected $_rowClass = 'Country_Model_Country';
  
  public function getCountries($params = array()){
        $select = $this->select();
                        
        
        if (isset($params['country_id']) && !empty($params['country_id'])){
            $select->where('country_id = ?',$params['country_id']);
        }
        if (isset($params['title']) && !empty($params['title'])){
            $select->where('title like ?','%'.$params['title'].'%');
        }
        
        $countries = $this->fetchAll($select);
        return $countries;
  }
         
}
